/*
 * @Description: 
 * @FilePath: /Area-cpp/src/area.cpp
 * @Author: Wei Zhou
 * @Github: https://github.com/muyi2414
 * @Date: 2019-09-20 19:47:33
 * @LastEditors: Wei Zhou
 * @LastEditTime: 2020-02-29 22:32:03
 * @Copyright: Copyright © 2017 muyiro. All rights reserved.
 */

#include <iostream>
#include <string>
#include "calculator.h"

int main(int argc, char const *argv[])
{
    std::string str;
    double result = 0;
    Calculator calculator;

    // std::cout << "__cplusplus" << __cplusplus << std::endl;
    std::cout << "Please end with 'EOF'" << std::endl;
    std::cout << "---------------------------" << std::endl;
    std::cout << "(Windows     : ctrl + z)" << std::endl;
    std::cout << "(Linux/MacOS : control + d)" << std::endl;
    std::cout << "---------------------------" << std::endl; 
    std::cout << "Please input a formula: " << std::endl;
    while (true)
    {
        std::cin >> str;
        calculator.setFormula(str);
        calculator.count(result);
        std::cout << "------------------------------------" << std::endl;
        std::cout << "result = " << result << std::endl << std::endl;
        std::cout << "====================================" << std::endl;
        std::cout << "Please input a formula: " << std::endl;
    }
    return 0;
}
